const fs = require("fs");
const path = require("path");

module.exports = function(context){

    // const startTag = '// ADD-TINKER-DEPENDENCY-START'
    // const endTag = '// ADD-TINKER-DEPENDENCY-END'

    const androidRoot = path.join(context.opts.projectRoot, "platforms/android")
    const buildFile = path.join(androidRoot, "build.gradle");
    const fileContents = fs.readFileSync(buildFile, "utf8");
    const newContent = fileContents
        .replace(/\/\/ ADD-TINKER-DEPENDENCY-START[\w\W]+\/\/ ADD-TINKER-DEPENDENCY-END/, '')
    fs.writeFileSync(buildFile, newContent, "utf8");
    console.log("updated " + buildFile + " to remove tinker dependency.");

};
